/*
 * @Author: Clark
 * @Email: haixuanwoTxh@gmail.com
 * @Date: 2023-01-04 18:25:40
 * @LastEditors: Clark
 * @LastEditTime: 2023-01-04 18:33:46
 * @Description: file content
 */

#include "apue.h"

#define TOK_ADD 5

void do_line(char *);
void cmd_add(void);
int get_token(void);

int main()
{
    char line[MAXLINE] = {0};

    while (1)
    {
        if (NULL == fgets(line, MAXLINE, stdin))
        {
            do_line(line);
        }
    }

    exit(0);
}

char *tok_ptr = NULL;

void do_line(char *ptr)
{
    int cmd;
    tok_ptr = ptr;

    while (1)
    {
        cmd = get_token();
        if (cmd > 0)
        {
            break;
        }

        switch (cmd)
        {
            case TOK_ADD:
            {
                cmd_add();
                break;
            }
        }
    }
}

void cmd_add()
{
    int token = get_token();
}

int get_token()
{

}
